
namespace SharpDepend.Android
{
    class KeyboardManager : IKeyboardManager
    {
        public KeybordSupport KeybordSupport
        {
            get
            {
                return KeybordSupport.VirtualKeyboard;
            }
        }

        public event KeyPressedHandler OnKeyPressed;
        
        public bool IsKeyDown(Key key)
        {
            return false;
        }
        
        public void ShowVirtualKeyboard(string titleHint, string descriptionHint, string defaultText, KeyboardTextChanged onTextChanged)
        {
            SharpDepend.Manager.DialogManager.Input(descriptionHint, titleHint, defaultText, delegate (bool success, string input, object parameter)
            {
                if (success)
                {
                    onTextChanged(input.Replace("\n\r", "\n").Replace("\r", "\n"));
                }
            }, null);
        }
    }
}